#ifndef PLOTDIALOG_H
#define PLOTDIALOG_H

#include <QDialog>
#include "three_soft/qcustomplot.h"
#include <QDateTime>

extern QVector<QDateTime>gui_time;
extern QVector<double>myguiData;

class PlotDialog : public QDialog
{
    Q_OBJECT

public:
    explicit PlotDialog(QWidget *parent = nullptr);
    ~PlotDialog();

private:
    QCustomPlot *customPlot;
    QCPItemLine *cursorLine; // 竖向光标
    QCPItemText *cursorLabel; // 显示交点Y值的标签
    void setupPlot();
    void setupCursor();

private slots:
    void onMouseMove(QMouseEvent *event);
    void onMousePress(QMouseEvent *event);
    void onMouseRelease(QMouseEvent *event);
};

#endif // PLOTDIALOG_H
